    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <head>
        <title>Title</title>
        <style>
            *{
                user-select: none;
                /* 无法选中，整体感更强 */
            }

            body{
                background-image: url("./wallpaper.jpg");
                background-size: cover;
                background-attachment: fixed;
            }

            .login{
                position: absolute;
                top: 50%;
                margin-top: -200px;
                left: 50%;
                margin-left: -200px;
                /* absolute居中的一种方法 */
                background-color: whitesmoke;
                width: 400px;
                height: 400px;
                border-radius: 25px;
                text-align: center;
                padding: 5px 40px;
                box-sizing: border-box;
                /* 这样padding就不会影响大小 */
            }

            p{
                font-size: 42px;
                font-weight: 600;
            }

            input{
                background-color: whitesmoke;
                width: 100%;
                height: 48px;
                margin-bottom: 10px;
                border: none;
                border-bottom: 2px solid silver;
                /* 下面的会覆盖上面的步伐 */
                outline: none;
                font-size: 22px;
            }

            .btn{
                background-color: #59c2c5;
                width: 38%;
                height: 48px;
                border-radius: 8px;
                margin-top: 40px;
                font-size: 28px;
                font-weight: 600;
                color: white;
            }
            .btn:hover{
                background-color: #59c2a0;
            }
        </style>
    </head>
    <body>
    <h1 style="text-align: center">登录页面</h1>
    <%--<form action="/glh/register" method="get">--%>

<%--    <img src="/wallpaper.jpg">--%>
    <form action="" class="login">
        用户名: <input id="input1" type="text" name="username"/><br>
        密码: <input id="input2" type="password" name="password"/><br>
        <input class="btn" type="button" id="btn01" value="登录">
        <br>
        <a href="/stadium/usermanagement_page/regiser.jsp">没有账号，点我注册</a>
    </form>


    <script type="text/javascript" src="../reservation_page/js/jquery-3.6.4.js"></script>
    <script>
        var student={};
        var arr=[];
        $(function(){
            $("#btn01").click(function(){
                var nm=$("#input1").val();
                var pw=$("#input2").val();

                var user={"userAccount":nm,"userPassword":pw};
                $.ajax({
                    type:"post",
                    url:"http://localhost:8080/stadium/glh/login",
                    data:JSON.stringify(user),
                    dataType:"json",
                    success:function(data) {
                     console.log(data)

                    if(data!=null){
                        window.location.href = "http://localhost:8080/stadium/lyg";
                    }
                    else{
                        alert("登录失败");
                    }

                    }
                })
            })
        })
    </script>
    <body>


